//
//  NSString+Function.m
//  u76ho
//
//  Created by m-air-01 on 15/12/25.
//  Copyright © 2015年 LV. All rights reserved.
//

#import "NSString+Function.h"

@implementation NSString (Function)

-(CGFloat)widthOfSize:(CGFloat)fontSize{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    
    CGFloat width = [self sizeWithFont:[UIFont systemFontOfSize:fontSize] constrainedToSize:CGSizeMake(MAXFLOAT,20) lineBreakMode:NSLineBreakByCharWrapping].width;
#pragma clang diagnostic pop
    return width;
}
- (CGFloat)heightOfSize:(CGFloat)fontSize width:(CGFloat)width{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    
    CGSize  size=[self sizeWithFont:[UIFont systemFontOfSize:fontSize] constrainedToSize:CGSizeMake(width,MAXFLOAT+10) lineBreakMode:NSLineBreakByCharWrapping];
    
#pragma clang diagnostic pop
    return size.height;
}

@end
